#ifndef RTBASE_H
#define RTBASE_H

//#define RT_SUPPORT_QOS

#include "RtDefines.h"
#include "RtError.h"
#include "RtDebug.h"
#include "RtStdCpp.h"
#include "RtReferenceControl.h"
#include "RtMutex.h"
#include "RtThreadManager.h"
#include "RtThread.h"
#include "RtUtilClasses.h"
#include "RtErrorNetwork.h"
#include "RtTimeValue.h"

extern "C"
{
	RT_API_EXPORT void RtBase64Encode(
		const unsigned char *bufin, 
		DWORD nbytes, 
		CRtString &sbDest);
	RT_API_EXPORT void RtBase64Decode(
		const char *bufcoded, 
		CRtString &sbDest);
	RT_API_EXPORT const char* rt_strcaserstr(
		const char *big, 
		const char *little);
	RT_API_EXPORT DWORD RtGetLocalIP();

#ifdef RT_WIN32
	RT_API_EXPORT RtResult RtCoInitialize();
	RT_API_EXPORT void RtCoUninitialize();
#else
	RT_API_EXPORT void Sleep(DWORD dwMillionSecond);
#endif // RT_WIN32

	RT_API_EXPORT LONGLONG GetTickCountEx();
	RT_API_EXPORT RT_THREAD_ID RtGetCurrentThreadId();
}

inline RT_THREAD_ID RtGetCurrentThreadId()
{
#ifdef RT_WIN32
	return ::GetCurrentThreadId();
#else
	return ::pthread_self();
#endif // RT_WIN32
}

#endif // !RTBASE_H
